package com.lau.base.reflect;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

/**
 * Created by liutf on 2016/8/10.
 */
public class MyMethodTest {

    public void sayHello(){
        System.out.println("hello..");
    }

    public void sayHelloByParam(String name,int age){
        System.out.println("hello..");
    }

    public void sayByeByParam(String sex , String tel){
        System.out.println("hello..");
    }

    public static void main(String[] args) {
        Method[] methods = MyMethodTest.class.getDeclaredMethods();
        for (Method method : methods) {
            System.out.println("method - " + method.getName());
            Parameter[] parameters = method.getParameters();
            for (Parameter parameter : parameters) {
                System.out.println(parameter.getName() + " - type:" + parameter.getType());
            }
        }
    }

}
